<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link class="bootstrap library" rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link class="bootstrap library" rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css">
<script class="bootstrap library" src="js/jquery-2.1.1.min.js" type="text/javascript"></script>
<script class="bootstrap library" src="js/bootstrap.min.js" type="text/javascript"></script>
</head>

<body style="background-color:#F7F7F7">
<div class="container" >
<button type="button" class="btn " style="margin-top:10pt">返回首页</button>
<div>
<table class="table">
   <thead>
      <tr>
         <th>订单号</th>
         <th>商品类型</th>
         <th>价格</th>
         <th>购买时间</th>
         <th>续费前过期时间</th>
         <th>续费后过期时间</th>
         <th>操作</th>
      </tr>
   </thead>
   <tbody>
      <tr>
         <td>12345678</td>
          <td>买三送一</td>
          <td>100.00</td>
           <td>2014-9-8 17：30</td>
           <td>2015-9-8 17：30</td>
           <td>2016-9-8 17：30</td>
            <td><a>删除</a></td>
      </tr>
      <tr>
         <td>12345678</td>
          <td>买三送一</td>
          <td>100.00</td>
           <td>2014-9-8 17：30</td>
           <td>2015-9-8 17：30</td>
           <td>2016-9-8 17：30</td>
            <td><a>删除</a></td>
      </tr>
      <tr>
         <td>12345678</td>
          <td>买三送一</td>
          <td>100.00</td>
           <td>2014-9-8 17：30</td>
           <td>2015-9-8 17：30</td>
           <td>2016-9-8 17：30</td>
            <td><a>删除</a></td>
      </tr>
      
   </tbody>
</table>
</div>
<form action="saveOrder" id="form" method="post">
<div class="radio">
  <label>
    <input type="radio" name="radio" value="2" checked>
    套餐二：续费一个月 </label>
</div>
<div class="radio">
  <label>
    <input type="radio" name="radio" value="3">
    套餐三：买三送一 </label>
</div>
<div class="radio">
  <label>
    <input type="radio" name="radio"
         value="4">
    套餐四：半年送三个月 </label>
</div>
<input type="hidden" name="time" id="time">
<input type="hidden" name="price" id="price">
<button type="button" onclick="st()"  class="btn btn-lg btn-block btn-primary">提交</button>
</form>
</div>
<script type="text/javascript">
        function st() {
            var arr = document.getElementsByName('radio');
            for (var i = 0; i < arr.length; i++) {
                if (arr[i].checked) {
                    var value = arr[i].value;
					alert(value);
                    var priceArr = [220, 220, 660, 1320];
                    var timeArr  = [7776000000, 2592000000, 10368000000, 23328000000];
                    
					$('#time').val(timeArr[value - 1]);
                    $('#price').val(priceArr[value - 1]);
                    $('#form').submit();
                    break;
                }
            }
        }
</script>
</body>
</html>
